#include "pch.h"
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>

using namespace std;


class Solution {
public:
	string countAndSay(int n) {
		string last = "1";
		if (n == 1) return last;
		string temp;
		for (int j = 0;j < n - 1;j++)
		{
			int counts = 1;
			for (int i = 0;i < last.length();i++)
			{
				if (i + 1 == last.length() || last[i] != last[i + 1])
				{
					temp += to_string(counts);
					temp.push_back(last[i]);
					counts = 1;
				}
				else
				{
					counts++;
				}
			}
			last = temp;
			temp.clear();
		}
		return last;
	}
};

int main()
{
	int num;
	cin >> num;
	Solution s;
	string res = s.countAndSay(num);
	cout << res << endl;
	return 0;
}